import routeComponentName from '@/config/route-component-name'

const codeRouter = [
  {
    path: '/code',
    component: () => import('@/layout/index.vue'),
    name: 'code',
    meta: {
      title: '序列号管理',
      icon: 'Film',
    },
    redirect: '/code/list',
    children: [
      {
        path: 'list',
        component: () => import('@/views/code/list/index.vue'),
        name: 'codeList',
        meta: {
          title: '序列号列表',
          keepAlive: true,
          componentName: routeComponentName.snCode.codeList,
        },
      },
      {
        path: 'new',
        component: () => import('@/views/code/new/index.vue'),
        name: 'newCode',
        meta: {
          title: '批次列表',
          keepAlive: true,
          componentName: routeComponentName.snCode.batchList,
        },
      },
      // {
      //   path: 'online',
      //   component: () => import('@/views/code/online/index.vue'),
      //   name: 'codeOnline',
      //   meta: {
      //     title: '在线打码',
      //     keepAlive: true,
      //     componentName: routeComponentName.snCode.codeingOnline,
      //   },
      // },
      {
        path: 'war',
        component: () => import('@/views/code/war/index.vue'),
        name: 'warCode',
        meta: {
          title: '防伪窜货',
          keepAlive: true,
          componentName: routeComponentName.snCode.authFleeingGood,
        },
        hidden: true,
      },
      // 跳转页面
      // {
      //   path: 'recycle',
      //   component: () => import('@/views/code/list/recycle/index.vue'),
      //   name: 'Recycle',
      //   meta: { title: '回收站', keepAlive: true },
      //   hidden: true,
      // },
      {
        path: 'codetail/:id/:tableType',
        component: () => import('@/views/code/list/detail/index.vue'),
        name: 'coDetail',
        meta: {
          title: '序列号详细',
          keepAlive: true,
          componentName: routeComponentName.snCode.snCodeDetail,
        },
        hidden: true,
      },
      {
        path: 'codeExcelImport',
        component: () => import('@/views/excel/index.vue'),
        name: 'codeExcelImport',
        meta: {
          title: '序列号档案导入',
          keepAlive: true,
          componentName: routeComponentName.common.import,
        },
        hidden: true,
      },
      {
        path: 'batch/:id',
        component: () => import('@/views/code/new/batch/index.vue'),
        name: 'batch',
        meta: {
          title: '批次详情',
          keepAlive: true,
          componentName: routeComponentName.snCode.batchDetail,
        },
        hidden: true,
      },
      {
        path: 'printtemp',
        component: () => import('@/views/code/online/module/PrintTemplate.vue'),
        name: 'printTemp',
        meta: {
          title: '打印模版',
          keepAlive: true,
          componentName: routeComponentName.snCode.printTemplate,
        },
        hidden: true,
      },
      {
        path: 'blank/:id',
        component: () => import('@/views/code/online/module/BlankTemplate.vue'),
        name: 'blank',
        meta: {
          title: '创建空白模版',
          keepAlive: true,
          componentName: routeComponentName.snCode.emptyTemplateCreate,
        },
        hidden: true,
      },
    ],
  },
]

export default codeRouter
